/**
 * @version      BOSSCMS-Free
 * @trademark    BOSSCMS
 * @copyright    Copyright © by BOSSCMS-Free (https://www.bosscms.net/) 保留所有权利
 * @license      https://gitee.com/Greenpeas/BOSSCMS/license/ 和 https://www.bosscms.net/freelicense/
 * @link         https://www.bosscms.net/
 * @author       温州软界网络技术有限公司
**/
$(document).ready(function(e) {
	if($G['part']=='home' && $G['func']=='init'){
		obj = {host:window.location.href}		
		$.post('https://api.bosscms.net/rest/advert/',obj,function(data){
			$('section[advert]>div.advert').html(data.html);
			$('section[advert]').removeAttr('hide');
		},'json');
		$.post('https://api.bosscms.net/rest/donation/',obj,function(data){
			$('div.donation>div').html(data.html);
		},'json');
		$.get($.mpf('home','home','develop'),function(data){
			$('span.qq').html(data.qq);
		},'json');
		$('.caring.admin_folder').each(function(index, element) {
			$(this).addClass('active');
		});	
		$('.switch ol.tab>li').click(function(){
			$('.switch ol.tab>li').removeClass('on');
			$(this).addClass('on');
			$('.switch ul').removeClass('on').eq($(this).index()).addClass('on');
		});
		$('span[total]').each(function(){
			(function($,e){
				$.get($.mpf('home','home','total',{'type': $(e).attr('total')}),function(data){
					$(e).html(data);
				},'json');
			})($,this);
		});
	}
});